<!-- 高级检索 专利用 -->
<template>
  <ul class="search-area">
    <vue-scroll :ops="scrollOps">
      <!--Keyword-->
      <li>
        <el-form
          :model="firstRow"
          class="elform"
        >
          <span class="tit">关键词</span>
          <div class="form-item-box">
            <div class="item-box item-box1">
              <el-select v-model="firstRowtitleValue" class="elselect">
                <el-option
                  v-for="item in firstRow.titles"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </div>
            <div class="item-box item-box2">
              <!-- 提示信息 -->
              <el-popover
                placement="top"
                trigger="focus"
                width="384"
                popper-class="rowsPopover"
              >
                <div>
                  <p class="rowsPopover-p">
                    {{ $t("adv.input-1.title-1") }}<br />
                    {{ $t("adv.input-1.title-2") }}
                  </p>
                  <p>{{ $t("adv.input-1.title-3") }}</p>
                  <p>{{ $t("adv.input-1.title-4") }}</p>
                  <p>{{ $t("adv.input-1.title-5") }}</p>
                  <p>{{ $t("adv.input-1.title-6") }}</p>
                  <p>{{ $t("adv.input-1.title-7") }}</p>
                </div>
                <el-input
                  v-model="firstRow.input"
                  slot="reference"
                  @keydown.native="rowsPopoverHide()"
                >
                </el-input>
              </el-popover>
              <div class="color-box">
                <el-color-picker
                  v-model="firstRow.color"
                  class="colorPicker"
                  :predefine="predefineColors"
                ></el-color-picker>
              </div>
            </div>
            <div class="tools-box">
              <svg class="icon" aria-hidden="true" @click="addRow('Keyword')">
                <use xlink:href="#icon-tianjia"></use>
              </svg>
            </div>
          </div>
        </el-form>
      </li>
      <li>
        <el-form
          :model="secondRow[index]"
          class="elform"
          v-for="(item, index) in secondRow"
          :key="index"
        >
          <span class="tit"></span>
          <div class="form-item-box">
            <div class="item-box item-box1">
              <el-select class="elselect2 way" v-model="item.secondRoworValue">
                <el-option
                  v-for="ite in item.way"
                  :key="ite.value"
                  :label="ite.label"
                  :value="ite.value"
                >
                </el-option>
              </el-select>
              <el-select class="elselect2" v-model="item.secondRowtitleValue">
                <el-option
                  v-for="ite in item.titles"
                  :key="ite.value"
                  :label="ite.label"
                  :value="ite.value"
                >
                </el-option>
              </el-select>
            </div>
            <div class="item-box item-box2">
              <!-- 提示信息 -->
              <el-popover
                placement="top"
                width="384"
                trigger="focus"
                popper-class="rowsPopover"
              >
                <div>
                  <p class="rowsPopover-p">
                    {{ $t("adv.input-1.title-1") }}<br />
                    {{ $t("adv.input-1.title-2") }}
                  </p>
                  <p>{{ $t("adv.input-1.title-3") }}</p>
                  <p>{{ $t("adv.input-1.title-4") }}</p>
                  <p>{{ $t("adv.input-1.title-5") }}</p>
                  <p>{{ $t("adv.input-1.title-6") }}</p>
                  <p>{{ $t("adv.input-1.title-7") }}</p>
                </div>
                <el-input
                  v-model="secondRow[index].input"
                  slot="reference"
                  @keydown.native="rowsPopoverHide()"
                >
                </el-input>
              </el-popover>
              <div class="color-box">
                <el-color-picker
                  v-model="secondRow[index].color"
                  class="colorPicker"
                  :predefine="predefineColors"
                ></el-color-picker>
              </div>
            </div>
            <div class="tools-box">
              <svg
                class="icon"
                aria-hidden="true"
                @click="delRow(index, 'Keyword')"
              >
                <use xlink:href="#icon-jianqu"></use>
              </svg>
            </div>
          </div>
        </el-form>
      </li>
      <!--Category NO.-->
      <li>
        <el-form
          :model="thirdRow"
          class="elform"
        >
          <span class="tit">分类号</span>
          <div class="form-item-box">
            <div class="item-box item-box1">
              <el-select class="elselect" v-model="thirdRowCategoryValue">
                <el-option
                  v-for="item in thirdRow.Category"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </div>
            <div class="item-box item-box2">
              <el-input class="" v-model="thirdRow.input"> </el-input>
            </div>
            <div class="tools-box">
              <svg class="icon" aria-hidden="true" @click="addRow('Category')">
                <use xlink:href="#icon-tianjia"></use>
              </svg>
            </div>
          </div>
        </el-form>
      </li>
      <li>
        <el-form
          :model="fourthRow[index]"
          class="elform"
          v-for="(item, index) in fourthRow"
          :key="index"
        >
          <span class="tit"></span>
          <div class="form-item-box">
            <div class="item-box item-box1">
              <el-select class="elselect2 way" v-model="item.orValue" placeholder="and">
                <el-option
                  v-for="ite in item.way"
                  :key="ite.value"
                  :label="ite.label"
                  :value="ite.value"
                >
                </el-option>
              </el-select>
              <el-select class="elselect2" v-model="item.CategoryValue">
                <el-option
                  v-for="ite in item.Category"
                  :key="ite.value"
                  :label="ite.label"
                  :value="ite.value"
                >
                </el-option>
              </el-select>
            </div>
            <div class="item-box item-box2">
              <el-input class="" v-model="item.input"> </el-input>
            </div>
            <div class="tools-box">
              <svg
                class="icon"
                aria-hidden="true"
                @click="delRow(index, 'Category')"
              >
                <use xlink:href="#icon-jianqu"></use>
              </svg>
            </div>
          </div>
        </el-form>
      </li>
      <!--Name-->
      <li>
        <el-form
          :model="fifthRow"
          class="elform"
        >
          <span class="tit">名称</span>
          <div class="form-item-box">
            <div class="item-box item-box1">
              <el-select class="elselect" v-model="fifthRowNameValue">
                <el-option
                  v-for="item in fifthRow.Name"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </div>
            <div class="item-box item-box2">
              <el-input class="" v-model="fifthRow.input"> </el-input>
            </div>
            <div class="tools-box">
              <svg class="icon" aria-hidden="true" @click="addRow('Name')">
                <use xlink:href="#icon-tianjia"></use>
              </svg>
            </div>
          </div>
        </el-form>
      </li>
      <li>
        <el-form
          :model="sixthRow[index]"
          class="elform"
          v-for="(item, index) in sixthRow"
          :key="index"
        >
          <span class="tit"></span>
          <div class="form-item-box">
            <div class="item-box item-box1">
              <el-select class="elselect2 way" v-model="item.orValue" placeholder="and">
                <el-option
                  v-for="ite in item.way"
                  :key="ite.value"
                  :label="ite.label"
                  :value="ite.value"
                >
                </el-option>
              </el-select>
              <el-select class="elselect2" v-model="item.NameValue">
                <el-option
                  v-for="ite in item.Name"
                  :key="ite.value"
                  :label="ite.label"
                  :value="ite.value"
                >
                </el-option>
              </el-select>
            </div>
            <div class="item-box item-box2">
              <el-input class="" v-model="item.input"> </el-input>
            </div>
            <div class="tools-box">
              <svg class="icon" aria-hidden="true" @click="delRow(index, 'Name')">
                <use xlink:href="#icon-jianqu"></use>
              </svg>
            </div>
          </div>
        </el-form>
      </li>
      <!--NO.-->
      <li>
        <el-form
          :model="seventhRow"
          class="elform"
        >
          <span class="tit">号码</span>
          <div class="form-item-box">
            <div class="item-box item-box1">
              <el-select class="elselect" v-model="seventhRowNumValue">
                <el-option
                  v-for="item in seventhRow.Num"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </div>
            <div class="item-box item-box2">
              <el-input class="" v-model="seventhRow.input"> </el-input>
            </div>
            <div class="tools-box"></div>
          </div>
        </el-form>
      </li>
      <!--Date-->
      <li>
        <el-form
          :model="eighthRow"
          class="elform"
        >
          <span class="tit">日期</span>
          <div class="form-item-box2">
            <div class="display-box">
              <div class="item-box item-box1">
                <el-select class="elselect" v-model="eighthRowapplyDateVal">
                  <el-option
                    v-for="ite in eighthRow.applyDate"
                    :key="ite.value"
                    :label="ite.label"
                    :value="ite.value"
                  >
                  </el-option>
                </el-select>
              </div>
              <div class="item-box item-box2">
                <el-select class="elselect" v-model="eighthRowdateTypeVal">
                  <el-option
                    v-for="ite in eighthRow.dateType"
                    :key="ite.value"
                    :label="ite.label"
                    :value="ite.value"
                  >
                  </el-option>
                </el-select>
              </div>
              <div class="tools-box"></div>
            </div>
            <div class="display-box">
              <div class="item-box item-box1" v-if="eighthRowdateTypeVal != '4'">
                <el-date-picker
                  @change="IsDate"
                  v-model="eighthRow.startTime"
                  type="date"
                >
                </el-date-picker>
                <i class="iconfont icon-riqi"></i>
              </div>
              <div class="item-box date-to-box" v-if="eighthRowdateTypeVal == '1'">
                <span class="date-to" >to</span>
              </div>
              <div class="item-box item-box2" v-if="eighthRowdateTypeVal == '1'">
                <el-date-picker
                  @change="IsDate"
                  v-model="eighthRow.endTime"
                  type="date"
                  class="elpicker"
                >
                </el-date-picker>
                <i class="iconfont icon-riqi"></i>
              </div>
              <div class="item-box item-box2" v-if="eighthRowdateTypeVal == '4'">
                <el-date-picker
                  v-model="eighthRow.startTime"
                  type="year"
                  placeholder=""
                  class="elpicker"
                >
                </el-date-picker>
                <i class="iconfont icon-riqi"></i>
              </div>
              <div class="tools-box"></div>
            </div>
          </div>
        </el-form>
      </li>
      <!--CustomizedValue-->
      <!-- 2022-08 需求中将‘语义排序’ 字段去除 -->
      <!-- <li>
        <el-form
          :model="ninthRow[index]"
          class="elform"
          v-for="(item, index) in ninthRow"
          :key="index"
        >
          <span class="tit">语义排序</span>
          <div class="form-item-box">
            <div class="item-box">
              <el-input
                class=""
                v-model="item.CustomizedValue"
                :placeholder="$t('adv.ninthRowPlaceholder')"
              ></el-input>
            </div>
            <div class="tools-box"></div>
          </div>
        </el-form>
      </li> -->
    </vue-scroll>
    
    <li class="btn-box">
      <el-button @click="clearAll" class="clearBtn fl btn">清除</el-button>
      <el-button @click="search" class="searchBtn fr btn">检索</el-button>
    </li>
  </ul>
</template>

<script type="text/ecmascript-6">
import { mapState } from "vuex";
import Ecolors from "@/utils/chartColors.js";

export default {
  components: {},
  data() {
    return {
      predefineColors: Ecolors.color.slice(0, 10),
      searchInput: "",

      checkedAll: false,
      isCheckedAll: false,

      titles: [
        {
          //关键字
          value: "A/",
          label:
            this.$cookie.get("lang") === "en"
              ? "Title, Abstract, Patent claims"
              : "标题，摘要，权利要求",
        },
        {
          value: "(TTL/xxx or ABST/ yyy)",
          label: this.$cookie.get("lang") === "en" ? "Title Abstract" : "标题，摘要",
        },
        {
          value: "TTL/",
          label: this.$cookie.get("lang") === "en" ? "Title" : "标题",
        },
        {
          value: "ABST/",
          label: this.$cookie.get("lang") === "en" ? "Abstract" : "摘要",
        },
        {
          value: "ACLM/",
          label: this.$cookie.get("lang") === "en" ? "Patent claims" : "权利要求",
        },
        {
          value: "SPEC/",
          label: this.$cookie.get("lang") === "en" ? "Description" : "说明书",
        },
        {
          value: "B/",
          label: this.$cookie.get("lang") === "en" ? "Full text" : "全文",
        },
      ],
      way: [
        {
          //与或关系
          value: "or",
          label: "Or",
        },
        {
          value: "and",
          label: "And",
        },
      ],
      Category: [
        {
          //分类号分类
          value: "IPC/",
          label:
            this.$cookie.get("lang") === "en" ? "Class number" : "IPC(国际分类)",
        },
      ],
      Name: [
        //选择作者分类
        {
          value: "(AN/xxx or LSAN/xxx)",
          label:
            this.$cookie.get("lang") === "en"
              ? "Applicant or Assignee"
              : "申请人或受让人",
        },
        {
          value: "AN/",
          label: this.$cookie.get("lang") === "en" ? "Applicant" : "申请人",
        },
        {
          value: "AN1/",
          label:
            this.$cookie.get("lang") === "en" ? "First applicant" : "第一申请人",
        },
        {
          value: "ANN/",
          label:
            this.$cookie.get("lang") === "en" ? "Standard applicant" : "标准申请人",
        },
        {
          value: "IN/",
          label:
            this.$cookie.get("lang") === "en"
              ? "Inventor (Designer)"
              : "发明(设计)人",
        },
        {
          value: "IN1/",
          label: this.$cookie.get("lang") === "en" ? "First inventor" : "第一发明人",
        },
        {
          value: "LREP/",
          label: this.$cookie.get("lang") === "en" ? "Agent" : "代理人",
        },
      ],
      Num: [
        {
          //选择号码分类
          value: "PN/",
          label:
            this.$cookie.get("lang") === "en"
              ? "Public/Announcement number"
              : "公开/公告号",
        },
        {
          value: "APN/",
          label: this.$cookie.get("lang") === "en" ? "Application number" : "申请号",
        },
        {
          value: "PRIR/",
          label: this.$cookie.get("lang") === "en" ? "Priority number" : "优先权号",
        },
      ],
      applyDate: [
        {
          value: "APD/",
          label: this.$cookie.get("lang") === "en" ? "Application date" : "申请日",
        },
        {
          value: "ISD/",
          label:
            this.$cookie.get("lang") === "en" ? "Publication date" : "公开/公告日",
        },
        {
          value: "PRD/",
          label: this.$cookie.get("lang") === "en" ? "Priority date" : "优先权日",
        },
        {
          value: "GRD/",
          label: this.$cookie.get("lang") === "en" ? "Authorization date" : "授权日",
        },
      ], //申请日分类
      dateType: [
        {
          value: "1",
          label:
            this.$cookie.get("lang") === "en" ? "Particular period" : "起止时间",
        },
        {
          value: "2",
          label: this.$cookie.get("lang") === "en" ? "Before" : "之前",
        },
        {
          value: "3",
          label: this.$cookie.get("lang") === "en" ? "After" : "之后",
        },
        {
          value: "4",
          label: this.$cookie.get("lang") === "en" ? "Year" : "年",
        },
      ], //时间段分类
      Customized: [], //自定义分类
      firstRowtitleValue: "A/",
      firstRow: {
        titles: [
          {
            //关键字
            value: "A/",
            label:
              this.$cookie.get("lang") === "en"
                ? "Title, Abstract, Patent claims"
                : "标题，摘要，权利要求",
          },
          {
            value: "(TTL/xxx or ABST/ yyy)",
            label:
              this.$cookie.get("lang") === "en" ? "Title Abstract" : "标题，摘要",
          },
          {
            value: "TTL/",
            label: this.$cookie.get("lang") === "en" ? "Title" : "标题",
          },
          {
            value: "ABST/",
            label: this.$cookie.get("lang") === "en" ? "Abstract" : "摘要",
          },
          {
            value: "ACLM/",
            label: this.$cookie.get("lang") === "en" ? "Patent claims" : "权利要求",
          },
          {
            value: "SPEC/",
            label: this.$cookie.get("lang") === "en" ? "Description" : "说明书",
          },
          {
            value: "B/",
            label: this.$cookie.get("lang") === "en" ? "Full text" : "全文",
          },
        ],
        input: "",
        color: Ecolors.color[0],
      },
      secondRow: [
        {
          secondRoworValue: "and",
          secondRowtitleValue: "A/",
          input: "",
          way: [],
          titles: [],
          color: Ecolors.color[0],
        },
      ],
      thirdRowCategoryValue: "IPC/",
      thirdRow: {
        input: "",
        Category: [
          {
            //分类号分类
            value: "IPC/",
            label:
              this.$cookie.get("lang") === "en" ? "Class number" : "IPC(国际分类)",
          },
        ],
      },
      fourthRow: [
        {
          input: "",
          CategoryValue: "",
          way: [],
          orValue: "",
          Category: [],
        },
      ],
      fifthRowNameValue: "(AN/xxx or LSAN/xxx)",
      fifthRow: {
        Name: [
          //选择作者分类
          {
            value: "(AN/xxx or LSAN/xxx)",
            label:
              this.$cookie.get("lang") === "en"
                ? "Applicant or Assignee"
                : "申请人或受让人",
          },
          {
            value: "AN/",
            label: this.$cookie.get("lang") === "en" ? "Applicant" : "申请人",
          },
          {
            value: "AN1/",
            label:
              this.$cookie.get("lang") === "en" ? "First applicant" : "第一申请人",
          },
          {
            value: "ANN/",
            label:
              this.$cookie.get("lang") === "en"
                ? "Standard applicant"
                : "标准申请人",
          },
          {
            value: "IN/",
            label:
              this.$cookie.get("lang") === "en"
                ? "Inventor (Designer)"
                : "发明(设计)人",
          },
          {
            value: "IN1/",
            label:
              this.$cookie.get("lang") === "en" ? "First inventor" : "第一发明人",
          },
          {
            value: "LREP/",
            label: this.$cookie.get("lang") === "en" ? "Agent" : "代理人",
          },
        ],
        input: "",
      },
      sixthRow: [
        {
          way: [],
          orValue: "",
          NameValue: "",
          Name: [],
          input: "",
        },
      ],
      seventhRowNumValue: "PN/",
      seventhRow: {
        Num: [
          {
            //选择号码分类
            value: "PN/",
            label:
              this.$cookie.get("lang") === "en"
                ? "Public/Announcement number"
                : "公开/公告号",
          },
          {
            value: "APN/",
            label:
              this.$cookie.get("lang") === "en" ? "Application number" : "申请号",
          },
          {
            value: "PRIR/",
            label:
              this.$cookie.get("lang") === "en" ? "Priority number" : "优先权号",
          },
        ],
        input: "",
      },
      eighthRowapplyDateVal: "APD/",
      eighthRowdateTypeVal: "1",
      eighthRow: {
        applyDate: [
          {
            value: "APD/",
            label: this.$cookie.get("lang") === "en" ? "Application date" : "申请日",
          },
          {
            value: "ISD/",
            label:
              this.$cookie.get("lang") === "en" ? "Publication date" : "公开/公告日",
          },
          {
            value: "PRD/",
            label: this.$cookie.get("lang") === "en" ? "Priority date" : "优先权日",
          },
          {
            value: "GRD/",
            label:
              this.$cookie.get("lang") === "en" ? "Authorization date" : "授权日",
          },
        ],
        dateType: [
          {
            value: "1",
            label:
              this.$cookie.get("lang") === "en" ? "Particular period" : "起止时间",
          },
          {
            value: "2",
            label: this.$cookie.get("lang") === "en" ? "Before" : "之前",
          },
          {
            value: "3",
            label: this.$cookie.get("lang") === "en" ? "After" : "之后",
          },
          {
            value: "4",
            label: this.$cookie.get("lang") === "en" ? "Year" : "年",
          },
        ],
        startTime: "",
        endTime: "",
      },
      ninthRow: [
        {
          CustomizedValue: "",
          Customized: [],
          input: "",
        },
      ],
      searchMode: {
        input: "",
      },
      noResult: true,
      pageSize: 5,
      totalRow: 1,
      page: [
        {
          value: 5,
          label: "5",
        },
        {
          value: 10,
          label: "10",
        },
        {
          value: 20,
          label: "20",
        },
        {
          value: 50,
          label: "50",
        },
        {
          value: 100,
          label: "100",
        },
      ],
      currentPage: 1, //当前页数
      textarea: "",
      instructionCn: [
        {
          name: "AND",
          title: "AND 与运算S1 AND S2 求S1与S2的交集",
          content: "如: '手机' AND '移动终端'",
        },
        {
          name: "OR",
          title: "OR 或运算， S1 OR S2 求S1与S2的并集",
          content: "如: '手机' OR '移动终端'",
        },
        {
          name: "ANDNOT",
          title:
            "ANDNOT 异或运算（去除） S1 ANDNOT S2 从S1中去除与S2相同的部分",
          content: "如: '手机' ANDNOT '移动终端'",
        },
        {
          name: "adj/x",
          title: "adj/x 邻近短语搜索",
          content:
            "如cdma和station间相距小于等于x个字: 用b/'cdma adj/x station'。cdma和station的位置可互换，结果中二者的前后位置不做区分",
        },
        {
          name: "equ/x",
          title: "equ/x 邻近短语搜索",
          content: " 如cdma和station间相距等于x个字: 用b/'cdma equ/x station'",
        },
        {
          name: "nw/x",
          title: "nw/x 邻近短语搜索",
          content:
            "如检索字段/'word1 nw/x word2' word1和word2出现在同一句，相隔不超过x个词",
        },
        {
          name: "np/x",
          title: "np/x 邻近短语搜索",
          content:
            " 如检索字段/'word1 np/x word2' word1和word2出现在同一段，相隔不超过x个词",
        },
        {
          name: "?",
          title: "? 单字符通配符(替换单字符)",
          content: "如'text' or 'test'，用'te?t'",
        },
        {
          name: "*",
          title: "* 多字符通配符(替换0或多字符)",
          content: "如'test' or 'tests' or 'ester', 用'test*'",
        },
        {
          name: "~",
          title: "~ 模糊搜索",
          content: "拼法与'road'相似,如'load'、'read',用'road~'",
        },
      ],
      instructionEn: [
        {
          name: "AND",
          title:
            "AND with operations, S1 AND S2 find the intersection of S1 AND S2.",
          content: "Example: 'mobile phone' AND 'mobile terminal'.",
        },
        {
          name: "OR",
          title: "OR operation, S1 OR S2 find the union of S1 and S2.",
          content: "Example: 'mobile phone' OR 'mobile terminal'.",
        },
        {
          name: "ANDNOT",
          title:
            "ANDNOT XOR operation (remove) S1 ANDNOT S2 removes the same part as S2 from S1.",
          content: "Example: 'mobile phone' ANDNOT 'mobile terminal'.",
        },
        {
          name: "adj/x",
          title: "adj/x Adjacent phrase search.",
          content:
            "Example: the distance between CDMA and station is less than or equal to x words: b/'cdma adj/x station'. The positions of CDMA and station are interchangeable, and the positions of the two are not distinguished.",
        },
        {
          name: "equ/x",
          title: "equ/x Adjacent phrase search.",
          content:
            "Example: The distance between CDMA and station is equal to x words: b/'cdma equ/x station'.",
        },
        {
          name: "nw/x",
          title: "nw/x Adjacent phrase search.",
          content:
            "Example: The search fields /'word1 nw/x word2'word1 and word2 appear in the same sentence, separated by no more than x words.",
        },
        {
          name: "np/x",
          title: "np/x Adjacent phrase search.",
          content:
            " Example: The search fields /'word1 np/x word2'word1 and word2 appear in the same paragraph, separated by no more than x words.",
        },
        {
          name: "?",
          title: "? Single character wildcard (replacement single character).",
          content: "Example: 'text'or'test', with'te?t'.",
        },
        {
          name: "*",
          title:
            "* Multi character wildcard (replace 0 or multiple characters).",
          content: "Example: 'test'or'tests' or'ester', with'test*'.",
        },
        {
          name: "~",
          title: "~ Fuzzy search.",
          content:
            "Spelling is similar to'road', Example: 'load','read','road~'.",
        },
      ],
      historyTable: false,
      toolVisible: false,
      categoryTabs: "AP",
      searchInput: "",
      transferData: [
        {
          id: "1",
          num: "010038",
          name: "海欣股份",
          open: true,
          checked: false,
          children: [
            {
              id: "11",
              num: "010038-001",
              name: "上海海欣集团股份有限公司",
              open: false,
              checked: false,
              children: [
                {
                  id: "111",
                  num: "010038-001-other",
                  name: "其他子公司",
                  open: false,
                  checked: false,
                  children: [
                    {
                      id: "1111",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1112",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1113",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1114",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1115",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1116",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1117",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1118",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1119",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1120",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1121",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1122",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1123",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1124",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                    {
                      id: "1125",
                      num: "",
                      name: "其他子公司1",
                      open: false,
                      checked: false,
                    },
                  ],
                },
              ],
            },
          ],
        },
      ],
      selecedtData: [],
      currNode: [],
      scrollOps: {
        vuescroll: {
          mode: 'native',
          sizeStrategy: 'number',
          detectResize: true,
          wheelScrollDuration: 200
        },
        scrollPanel: {
          initialScrollX: false,
          initialScrollY: false,
          scrollingX: false,
          scrollingY: true,
          speed: 1000,
          // easing: 'easeInQuad',
          maxHeight: 360
        },
        rail: {
          size: '6px',
          gutterOfEnds: '10px',
          gutterOfSide: '0px',
          keepShow: true,
        },
        bar: {
          onlyShowBarOnScroll: false,
          keepShow: true,
          background: '#adc2ca',
          size: '6px'
        },
      },
    };
  },
  
  computed: {
    ...mapState(["advancedSearchWord", ]),
  },
  methods: {
    init() {
      $("body").on("click", ".colorPicker", function () {
        setTimeout(() => {
          $(".rowsPopover").hide();
        }, 50);
        return false;
      });
    },
    /*
     * params: 无
     * return: 无
     * function: 隐藏input提示框
     * */
    rowsPopoverHide() {
      $(".rowsPopover").hide();
    },
    /*
     * params: 无
     * return: 无
     * function: 补零
     * */
    Appendzero(obj) {
      if (obj < 10) return "0" + "" + obj;
      else return obj;
    },
    /*
     * params: 无
     * return: 无
     * function: 判断时间是否合规
     * */
    IsDate() {
      let a = this.eighthRow.startTime,
        b = this.eighthRow.endTime;
      if (a && b && a > b) {
        this.$message({
          message:
            this.$cookie.get("lang") === "en"
              ? "The start time is not more than the end time!"
              : "开始时间不能大于结束时间！",
          duration: 1500,
          center: true,
        });
        this.eighthRow.startTime = this.eighthRow.endTime = "";
      } else if (b > new Date()) {
        this.$message({
          message:
            this.$cookie.get("lang") === "en"
              ? "The end time cannot be greater than the current time!"
              : "结束时间不能大于当前时间！",
          duration: 1500,
          center: true,
        });
        this.eighthRow.endTime = "";
      } else if (a > new Date()) {
        this.$message({
          message:
            this.$cookie.get("lang") === "en"
              ? "The start time cannot be greater than the current time!"
              : "开始时间不能大于当前时间！",
          duration: 1500,
          center: true,
        });
        this.eighthRow.startTime = "";
      }
    },
    /*
     * params: 添加行的类型
     * return: 无
     * function: 添加行
     * */
    addRow(type) {
      var newRow = {};
      if (type === "Keyword") {
        newRow["input"] = "";
        newRow["way"] = this.way;
        newRow["titles"] = this.titles;
        this.$set(newRow, "secondRoworValue", "and");
        this.$set(newRow, "secondRowtitleValue", "A/");
        newRow["color"] = Ecolors.color[0];
        this.secondRow.push(newRow);
      } else if (type === "Category") {
        newRow["input"] = "";
        newRow["way"] = this.way;
        newRow["Category"] = this.Category;
        this.$set(newRow, "orValue", "and");
        this.$set(newRow, "CategoryValue", "IPC/");
        this.fourthRow.push(newRow);
      } else if (type === "Name") {
        newRow["input"] = "";
        newRow["way"] = this.way;
        newRow["Name"] = this.Name;
        this.$set(newRow, "orValue", "and");
        this.$set(newRow, "NameValue", "(AN/xxx or LSAN/xxx)");
        this.sixthRow.push(newRow);
      } else if (type === "Customized") {
        /*else if(type === "NO"){
        newRow['input'] = "";
        newRow['Num'] = this.Num;
        newRow['NumValue'] = "";
        this.seventhRow.push(newRow);
      }*/ newRow[
          "input"
        ] = "";
        newRow["Customized"] = this.Customized;
        newRow["CustomizedValue"] = "";
        this.ninthRow.push(newRow);
      }
    },
    /*
     * params: 删除行的类型与索引
     * return: 无
     * function: 删除行
     * */
    delRow(index, type) {
      if (type === "Keyword") {
        this.secondRow.splice(index, 1);
      } else if (type === "Category") {
        this.fourthRow.splice(index, 1);
      } else if (type === "Name") {
        this.sixthRow.splice(index, 1);
      } else if (type === "Customized") {
        /*else if(type === "NO"){
        this.seventhRow.splice(index,1);
      }*/ this.ninthRow.splice(
          index,
          1
        );
      }
    },
    /*
     * params: 无
     * return: 无
     * function: 查询
     * */
    search() {
      var all = "",
        one = "",
        two = "",
        twoinput = [],
        twovalue = [],
        twoorvalue = [],
        three = "",
        four = "",
        fourinput = [],
        fourvalue = [],
        fourorvalue = [],
        five = "",
        six = "",
        sixinput = [],
        sixvalue = [],
        sixorvalue = [],
        seven = "",
        eight = "",
        nine = "";
      if (this.firstRow.input) {
        if (this.firstRowtitleValue == "(TTL/xxx or ABST/ yyy)") {
          if (
            this.firstRow.input.toLowerCase().indexOf(" and ") > -1 ||
            this.firstRow.input.toLowerCase().indexOf(" or ") > -1 ||
            this.firstRow.input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            one =
              "(TTL/(" +
              this.firstRow.input +
              ") or ABST/(" +
              this.firstRow.input +
              "))";
          } else {
            one =
              "(TTL/" +
              this.firstRow.input +
              " or ABST/" +
              this.firstRow.input +
              ")";
          }
        } else {
          if (
            this.firstRow.input.toLowerCase().indexOf(" and ") > -1 ||
            this.firstRow.input.toLowerCase().indexOf(" or ") > -1 ||
            this.firstRow.input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            one = this.firstRowtitleValue + "(" + this.firstRow.input + ")";
          } else {
            one = this.firstRowtitleValue + this.firstRow.input;
          }
        }
      }

      for (let i = 0; i < this.secondRow.length; i++) {
        if (this.secondRow[i].input && one) {
          if (
            this.secondRow[i].secondRowtitleValue == "(TTL/xxx or ABST/ yyy)"
          ) {
            if (
              this.firstRow.input.toLowerCase().indexOf(" and ") > -1 ||
              this.firstRow.input.toLowerCase().indexOf(" or ") > -1 ||
              this.firstRow.input.toLowerCase().indexOf(" andnot ") > -1
            ) {
              two +=
                " " +
                this.secondRow[i].secondRoworValue +
                " " +
                "(TTL/(" +
                this.secondRow[i].input +
                ") or ABST/(" +
                this.secondRow[i].input +
                "))";
            } else {
              two +=
                " " +
                this.secondRow[i].secondRoworValue +
                " " +
                "(TTL/" +
                this.secondRow[i].input +
                " or ABST/" +
                this.secondRow[i].input +
                ")";
            }
          } else {
            if (
              this.secondRow[i].input.toLowerCase().indexOf(" and ") > -1 ||
              this.secondRow[i].input.toLowerCase().indexOf(" or ") > -1 ||
              this.secondRow[i].input.toLowerCase().indexOf(" andnot ") > -1
            ) {
              two +=
                " " +
                this.secondRow[i].secondRoworValue +
                " " +
                this.secondRow[i].secondRowtitleValue +
                "(" +
                this.secondRow[i].input +
                ")";
            } else {
              two +=
                " " +
                this.secondRow[i].secondRoworValue +
                " " +
                this.secondRow[i].secondRowtitleValue +
                this.secondRow[i].input;
            }
          }
        } else if (this.secondRow[i].input && !one) {
          twoinput.push(this.secondRow[i].input);
          twovalue.push(this.secondRow[i].secondRowtitleValue);
          twoorvalue.push(this.secondRow[i].secondRoworValue);
        }
      }
      if (!one && twoinput) {
        twoorvalue[0] = "";
        for (var i = 0; i < twoinput.length; i++) {
          if (twovalue[i] == "(TTL/xxx or ABST/ yyy)") {
            if (
              twoinput[i].toLowerCase().indexOf(" and ") > -1 ||
              twoinput[i].toLowerCase().indexOf(" or ") > -1 ||
              twoinput[i].toLowerCase().indexOf(" andnot ") > -1
            ) {
              two +=
                twoorvalue[i] +
                " " +
                "(TTL/(" +
                twoinput[i] +
                ") or ABST/(" +
                twoinput[i] +
                "))" +
                " ";
            } else {
              two +=
                twoorvalue[i] +
                " " +
                "(TTL/" +
                twoinput[i] +
                " or ABST/" +
                twoinput[i] +
                ")" +
                " ";
            }
          } else {
            if (
              twoinput[i].toLowerCase().indexOf(" and ") > -1 ||
              twoinput[i].toLowerCase().indexOf(" or ") > -1 ||
              twoinput[i].toLowerCase().indexOf(" andnot ") > -1
            ) {
              two +=
                twoorvalue[i] + " " + twovalue[i] + "(" + twoinput[i] + ") ";
            } else {
              two += twoorvalue[i] + " " + twovalue[i] + twoinput[i] + " ";
            }
          }
        }
      }

      if (this.thirdRow.input && (one || two)) {
        if (
          this.thirdRow.input.toLowerCase().indexOf(" and ") > -1 ||
          this.thirdRow.input.toLowerCase().indexOf(" or ") > -1 ||
          this.thirdRow.input.toLowerCase().indexOf(" andnot ") > -1
        ) {
          three =
            " and " +
            this.thirdRowCategoryValue +
            "(" +
            this.thirdRow.input +
            ")";
        } else {
          three = " and " + this.thirdRowCategoryValue + this.thirdRow.input;
        }
      } else if (this.thirdRow.input && !one && !two) {
        if (
          this.thirdRow.input.toLowerCase().indexOf(" and ") > -1 ||
          this.thirdRow.input.toLowerCase().indexOf(" or ") > -1 ||
          this.thirdRow.input.toLowerCase().indexOf(" andnot ") > -1
        ) {
          three = this.thirdRowCategoryValue + "(" + this.thirdRow.input + ")";
        } else {
          three = this.thirdRowCategoryValue + this.thirdRow.input;
        }
      }

      for (var i = 0; i < this.fourthRow.length; i++) {
        if (this.fourthRow[i].input && (one || two || three)) {
          if (
            this.fourthRow[i].input.toLowerCase().indexOf(" and ") > -1 ||
            this.fourthRow[i].input.toLowerCase().indexOf(" or ") > -1 ||
            this.fourthRow[i].input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            four +=
              " " +
              this.fourthRow[i].orValue +
              " " +
              this.fourthRow[i].CategoryValue +
              "(" +
              this.fourthRow[i].input +
              ")";
          } else {
            four +=
              " " +
              this.fourthRow[i].orValue +
              " " +
              this.fourthRow[i].CategoryValue +
              this.fourthRow[i].input;
          }
        } else if (this.fourthRow[i].input && !one && !two && !three) {
          fourinput.push(this.fourthRow[i].input);
          fourvalue.push(this.fourthRow[i].CategoryValue);
          fourorvalue.push(this.fourthRow[i].orValue);
        }
      }
      if (!one && !two && !three && fourinput) {
        fourorvalue[0] = "";
        for (var i = 0; i < fourinput.length; i++) {
          if (
            fourinput[i].toLowerCase().indexOf(" and ") > -1 ||
            fourinput[i].toLowerCase().indexOf(" or ") > -1 ||
            fourinput[i].toLowerCase().indexOf(" andnot ") > -1
          ) {
            four +=
              fourorvalue[i] + " " + fourvalue[i] + "(" + fourinput[i] + ") ";
          } else {
            four += fourorvalue[i] + " " + fourvalue[i] + fourinput[i] + " ";
          }
        }
      }

      if (this.fifthRow.input && (one || two || three || four)) {
        if (this.fifthRowNameValue == "(AN/xxx or LSAN/xxx)") {
          if (
            this.fifthRow.input.toLowerCase().indexOf(" and ") > -1 ||
            this.fifthRow.input.toLowerCase().indexOf(" or ") > -1 ||
            this.fifthRow.input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            five =
              " and " +
              "(AN/(" +
              this.fifthRow.input +
              ") or LSAN/(" +
              this.fifthRow.input +
              "))";
          } else {
            five =
              " and " +
              "(AN/" +
              this.fifthRow.input +
              " or LSAN/" +
              this.fifthRow.input +
              ")";
          }
        } else {
          five = " and " + this.fifthRowNameValue + this.fifthRow.input;
        }
      } else if (this.fifthRow.input && !one && !two && !three && !four) {
        if (this.fifthRowNameValue == "(AN/xxx or LSAN/xxx)") {
          if (
            this.fifthRow.input.toLowerCase().indexOf(" and ") > -1 ||
            this.fifthRow.input.toLowerCase().indexOf(" or ") > -1 ||
            this.fifthRow.input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            five =
              "(AN/(" +
              this.fifthRow.input +
              ") or LSAN/(" +
              this.fifthRow.input +
              "))";
          } else {
            five =
              "(AN/" +
              this.fifthRow.input +
              " or LSAN/" +
              this.fifthRow.input +
              ")";
          }
        } else {
          five = this.fifthRowNameValue + this.fifthRow.input;
        }
      }

      for (var i = 0; i < this.sixthRow.length; i++) {
        if (this.sixthRow[i].input && (one || two || three || four || five)) {
          if (this.sixthRow[i].NameValue == "(AN/xxx or LSAN/xxx)") {
            if (
              this.sixthRow[i].input.toLowerCase().indexOf(" and ") > -1 ||
              this.sixthRow[i].input.toLowerCase().indexOf(" or ") > -1 ||
              this.sixthRow[i].input.toLowerCase().indexOf(" andnot ") > -1
            ) {
              six +=
                " " +
                this.sixthRow[i].orValue +
                " " +
                "(AN/(" +
                this.sixthRow[i].input +
                ") or LSAN/(" +
                this.sixthRow[i].input +
                "))";
            } else {
              six +=
                " " +
                this.sixthRow[i].orValue +
                " " +
                "(AN/" +
                this.sixthRow[i].input +
                " or LSAN/" +
                this.sixthRow[i].input +
                ")";
            }
          } else {
            six +=
              " " +
              this.sixthRow[i].orValue +
              " " +
              this.sixthRow[i].NameValue +
              this.sixthRow[i].input;
          }
        } else if (
          this.sixthRow[i].input &&
          !one &&
          !two &&
          !three &&
          !four &&
          !five
        ) {
          sixinput.push(this.sixthRow[i].input);
          sixvalue.push(this.sixthRow[i].NameValue);
          sixorvalue.push(this.sixthRow[i].orValue);
        }
      }
      if (!one && !two && !three && !four && !five && sixinput) {
        sixorvalue[0] = "";
        for (var i = 0; i < sixinput.length; i++) {
          if (sixvalue[i] == "(AN/xxx or LSAN/xxx)") {
            if (
              sixinput.toLowerCase().indexOf(" and ") > -1 ||
              sixinput.toLowerCase().indexOf(" or ") > -1 ||
              sixinput.toLowerCase().indexOf(" andnot ") > -1
            ) {
              six +=
                sixorvalue[i] +
                " " +
                "(AN/(" +
                sixinput[i] +
                ") or LSAN/(" +
                sixinput[i] +
                "))" +
                " ";
            } else {
              six +=
                sixorvalue[i] +
                " " +
                "(AN/" +
                sixinput[i] +
                " or LSAN/" +
                sixinput[i] +
                ")" +
                " ";
            }
          }
          six += sixorvalue[i] + " " + sixvalue[i] + sixinput[i] + " ";
        }
      }

      if (
        this.seventhRow.input &&
        (one || two || three || four || five || six)
      ) {
        if (
          this.seventhRow.input.toLowerCase().indexOf(" and ") > -1 ||
          this.seventhRow.input.toLowerCase().indexOf(" or ") > -1 ||
          this.seventhRow.input.toLowerCase().indexOf(" andnot ") > -1
        ) {
          seven =
            " and " +
            this.seventhRowNumValue +
            "(" +
            this.seventhRow.input +
            ")";
        } else {
          seven = " and " + this.seventhRowNumValue + this.seventhRow.input;
        }
      } else if (
        this.seventhRow.input &&
        !one &&
        !two &&
        !three &&
        !four &&
        !five &&
        !six
      ) {
        if (
          this.seventhRow.input.toLowerCase().indexOf(" and ") > -1 ||
          this.seventhRow.input.toLowerCase().indexOf(" or ") > -1 ||
          this.seventhRow.input.toLowerCase().indexOf(" andnot ") > -1
        ) {
          seven = this.seventhRowNumValue + "(" + this.seventhRow.input + ")";
        } else {
          seven = this.seventhRowNumValue + this.seventhRow.input;
        }
      }

      if (
        this.eighthRow.startTime &&
        (one || two || three || four || five || six || seven)
      ) {
        var nowdate = new Date();
        if (this.eighthRowdateTypeVal == "1" && this.eighthRow.endTime) {
          eight =
            " and " +
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate()) +
            "-" +
            this.eighthRow.endTime.getFullYear() +
            this.Appendzero(this.eighthRow.endTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.endTime.getDate());
        } else if (this.eighthRowdateTypeVal == "2") {
          eight =
            " and " +
            this.eighthRowapplyDateVal +
            "-" +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate());
        } else if (this.eighthRowdateTypeVal == "3") {
          eight =
            " and " +
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate()) +
            "-" +
            nowdate.getFullYear() +
            this.Appendzero(nowdate.getMonth() + 1) +
            this.Appendzero(nowdate.getDate());
        } else if (this.eighthRowdateTypeVal == "4") {
          eight =
            " and " +
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear();
          // +
          // this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
          // this.Appendzero(this.eighthRow.startTime.getDate());
        } else {
          this.$message({
            message:
              this.$cookie.get("lang") === "en"
                ? "The start date and the end date cannot be empty"
                : "开始日期及结束日期不能为空",
            duration: 1500,
            center: true,
          });
        }
      } else if (
        this.eighthRow.startTime &&
        !one &&
        !two &&
        !three &&
        !four &&
        !five &&
        !six &&
        !seven
      ) {
        var nowdate = new Date();
        if (this.eighthRowdateTypeVal == "1" && this.eighthRow.endTime) {
          eight =
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate()) +
            "-" +
            this.eighthRow.endTime.getFullYear() +
            this.Appendzero(this.eighthRow.endTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.endTime.getDate());
        } else if (this.eighthRowdateTypeVal == "2") {
          eight =
            this.eighthRowapplyDateVal +
            "-" +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate());
        } else if (this.eighthRowdateTypeVal == "3") {
          eight =
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate()) +
            "-" +
            nowdate.getFullYear() +
            this.Appendzero(nowdate.getMonth() + 1) +
            this.Appendzero(nowdate.getDate());
        } else if (this.eighthRowdateTypeVal == "4") {
          eight =
            this.eighthRowapplyDateVal + this.eighthRow.startTime.getFullYear();
        } else {
          this.$message({
            message:
              this.$cookie.get("lang") === "en"
                ? "The start date and the end date cannot be empty"
                : "开始日期及结束日期不能为空",
            duration: 1500,
            center: true,
          });
        }
      }

      for (var i = 0; i < this.ninthRow.length; i++) {
        if (
          this.ninthRow[i].CustomizedValue &&
          (one || two || three || four || five || six || seven || eight)
        ) {
          if (
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" and ") >
              -1 ||
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" or ") >
              -1 ||
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" andnot ") >
              -1
          ) {
            nine += " and R/(" + this.ninthRow[i].CustomizedValue + ")";
          } else {
            nine += " and R/" + this.ninthRow[i].CustomizedValue;
          }
        } else if (
          this.ninthRow[i].CustomizedValue &&
          !one &&
          !two &&
          !three &&
          !four &&
          !five &&
          !six &&
          !seven &&
          !eight
        ) {
          if (
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" and ") >
              -1 ||
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" or ") >
              -1 ||
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" andnot ") >
              -1
          ) {
            nine += "R/(" + this.ninthRow[i].CustomizedValue + ")";
          } else {
            nine += "R/" + this.ninthRow[i].CustomizedValue;
          }
        }
      }
      if (nine.substr(nine.length - 5) == " and ") {
        nine = nine.substring(0, nine.length - 5);
      }
      all =
        one +
        " " +
        two +
        " " +
        three +
        " " +
        four +
        " " +
        five +
        " " +
        six +
        " " +
        seven +
        " " +
        eight +
        " " +
        nine;
      if (all.trim() == "") {
        this.$message({
          message:
            this.$cookie.get("lang") === "en"
              ? "Please enter the retrieval type"
              : "请输入检索式",
          duration: 1500,
          center: true,
        });
      } else {
        let sq = all
          .replace(/^\s*/g, "")
          .replace(/\s*$/g, "")
          .replace(/\s{2,}/g, " ");
        if(this.advancedSearchWord !== sq){
          //触发查询接口 存储高级检索式
          this.$store.commit("setAdvancedSearchWord", sq);
        }else{
          this.$message({
            message:"请换个检索词再试",
            duration: 1500,
            center: true,
          });
        }
        
        let keywords = [JSON.parse(JSON.stringify(this.firstRow)), ...JSON.parse(JSON.stringify(this.secondRow))]
        let highlightKeyWords = []
        keywords.forEach(v => {
          highlightKeyWords.push({
            words: v.input.trim(),
            color: v.color
          })
        })

        this.$store.commit("setHighlightKeyWords", {
          modes: highlightKeyWords,
          open: true
        })

        // 暂时先注释
        // this.$nextTick(() => {
        //   this.$router.push({
        //     name: 'PLSearchResult'
        //   })
        // });
      }
    },
    /*
     * params: 无
     * return: 无
     * function: 清空输入内容
     * */
    clearAll() {
      this.firstRow.input = "";
      this.firstRow.titleValue = "";
      this.secondRow = [];
      this.thirdRow.input = "";
      this.thirdRow.CategoryValueL = "";
      this.fourthRow = [];
      this.fifthRow.NameValue = "";
      this.fifthRow.input = "";
      this.sixthRow = [];
      this.seventhRow = {
        NumValue: "",
        Num: this.Num,
        input: "",
      };
      this.eighthRow = {
        applyDate: this.applyDate,
        applyDateVal: "",
        dateType: this.dateType,
        dateTypeVal: "",
        startTime: "",
        endTime: "",
      };
      this.ninthRow = [
        {
          CustomizedValue: "",
          Customized: this.Customized,
          input: "",
        },
      ];
    },
    /*
     * params: 无
     * return: 无
     * function: 生成检索式
     * */
    getMode() {
      var all = "",
        one = "",
        two = "",
        twoinput = [],
        twovalue = [],
        twoorvalue = [],
        three = "",
        four = "",
        fourinput = [],
        fourvalue = [],
        fourorvalue = [],
        five = "",
        six = "",
        sixinput = [],
        sixvalue = [],
        sixorvalue = [],
        seven = "",
        eight = "",
        nine = "";
      if (this.firstRow.input) {
        if (this.firstRowtitleValue == "(TTL/xxx or ABST/ yyy)") {
          if (
            this.firstRow.input.toLowerCase().indexOf(" and ") > -1 ||
            this.firstRow.input.toLowerCase().indexOf(" or ") > -1 ||
            this.firstRow.input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            one =
              "(TTL/(" +
              this.firstRow.input +
              ") or ABST/(" +
              this.firstRow.input +
              "))";
          } else {
            one =
              "(TTL/" +
              this.firstRow.input +
              " or ABST/" +
              this.firstRow.input +
              ")";
          }
        } else {
          if (
            this.firstRow.input.toLowerCase().indexOf(" and ") > -1 ||
            this.firstRow.input.toLowerCase().indexOf(" or ") > -1 ||
            this.firstRow.input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            one = this.firstRowtitleValue + "(" + this.firstRow.input + ")";
          } else {
            one = this.firstRowtitleValue + this.firstRow.input;
          }
        }
      }

      for (let i = 0; i < this.secondRow.length; i++) {
        if (this.secondRow[i].input && one) {
          if (
            this.secondRow[i].secondRowtitleValue == "(TTL/xxx or ABST/ yyy)"
          ) {
            if (
              this.firstRow.input.toLowerCase().indexOf(" and ") > -1 ||
              this.firstRow.input.toLowerCase().indexOf(" or ") > -1 ||
              this.firstRow.input.toLowerCase().indexOf(" andnot ") > -1
            ) {
              two +=
                " " +
                this.secondRow[i].secondRoworValue +
                " " +
                "(TTL/(" +
                this.secondRow[i].input +
                ") or ABST/(" +
                this.secondRow[i].input +
                "))";
            } else {
              two +=
                " " +
                this.secondRow[i].secondRoworValue +
                " " +
                "(TTL/" +
                this.secondRow[i].input +
                " or ABST/" +
                this.secondRow[i].input +
                ")";
            }
          } else {
            if (
              this.secondRow[i].input.toLowerCase().indexOf(" and ") > -1 ||
              this.secondRow[i].input.toLowerCase().indexOf(" or ") > -1 ||
              this.secondRow[i].input.toLowerCase().indexOf(" andnot ") > -1
            ) {
              two +=
                " " +
                this.secondRow[i].secondRoworValue +
                " " +
                this.secondRow[i].secondRowtitleValue +
                "(" +
                this.secondRow[i].input +
                ")";
            } else {
              two +=
                " " +
                this.secondRow[i].secondRoworValue +
                " " +
                this.secondRow[i].secondRowtitleValue +
                this.secondRow[i].input;
            }
          }
        } else if (this.secondRow[i].input && !one) {
          twoinput.push(this.secondRow[i].input);
          twovalue.push(this.secondRow[i].secondRowtitleValue);
          twoorvalue.push(this.secondRow[i].secondRoworValue);
        }
      }
      if (!one && twoinput) {
        twoorvalue[0] = "";
        for (var i = 0; i < twoinput.length; i++) {
          if (twovalue[i] == "(TTL/xxx or ABST/ yyy)") {
            if (
              twoinput[i].toLowerCase().indexOf(" and ") > -1 ||
              twoinput[i].toLowerCase().indexOf(" or ") > -1 ||
              twoinput[i].toLowerCase().indexOf(" andnot ") > -1
            ) {
              two +=
                twoorvalue[i] +
                " " +
                "(TTL/(" +
                twoinput[i] +
                ") or ABST/(" +
                twoinput[i] +
                "))" +
                " ";
            } else {
              two +=
                twoorvalue[i] +
                " " +
                "(TTL/" +
                twoinput[i] +
                " or ABST/" +
                twoinput[i] +
                ")" +
                " ";
            }
          } else {
            if (
              twoinput[i].toLowerCase().indexOf(" and ") > -1 ||
              twoinput[i].toLowerCase().indexOf(" or ") > -1 ||
              twoinput[i].toLowerCase().indexOf(" andnot ") > -1
            ) {
              two +=
                twoorvalue[i] + " " + twovalue[i] + "(" + twoinput[i] + ") ";
            } else {
              two += twoorvalue[i] + " " + twovalue[i] + twoinput[i] + " ";
            }
          }
        }
      }

      if (this.thirdRow.input && (one || two)) {
        if (
          this.thirdRow.input.toLowerCase().indexOf(" and ") > -1 ||
          this.thirdRow.input.toLowerCase().indexOf(" or ") > -1 ||
          this.thirdRow.input.toLowerCase().indexOf(" andnot ") > -1
        ) {
          three =
            " and " +
            this.thirdRowCategoryValue +
            "(" +
            this.thirdRow.input +
            ")";
        } else {
          three = " and " + this.thirdRowCategoryValue + this.thirdRow.input;
        }
      } else if (this.thirdRow.input && !one && !two) {
        if (
          this.thirdRow.input.toLowerCase().indexOf(" and ") > -1 ||
          this.thirdRow.input.toLowerCase().indexOf(" or ") > -1 ||
          this.thirdRow.input.toLowerCase().indexOf(" andnot ") > -1
        ) {
          three = this.thirdRowCategoryValue + "(" + this.thirdRow.input + ")";
        } else {
          three = this.thirdRowCategoryValue + this.thirdRow.input;
        }
      }

      for (var i = 0; i < this.fourthRow.length; i++) {
        if (this.fourthRow[i].input && (one || two || three)) {
          if (
            this.fourthRow[i].input.toLowerCase().indexOf(" and ") > -1 ||
            this.fourthRow[i].input.toLowerCase().indexOf(" or ") > -1 ||
            this.fourthRow[i].input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            four +=
              " " +
              this.fourthRow[i].orValue +
              " " +
              this.fourthRow[i].CategoryValue +
              "(" +
              this.fourthRow[i].input +
              ")";
          } else {
            four +=
              " " +
              this.fourthRow[i].orValue +
              " " +
              this.fourthRow[i].CategoryValue +
              this.fourthRow[i].input;
          }
        } else if (this.fourthRow[i].input && !one && !two && !three) {
          fourinput.push(this.fourthRow[i].input);
          fourvalue.push(this.fourthRow[i].CategoryValue);
          fourorvalue.push(this.fourthRow[i].orValue);
        }
      }
      if (!one && !two && !three && fourinput) {
        fourorvalue[0] = "";
        for (var i = 0; i < fourinput.length; i++) {
          if (
            fourinput[i].toLowerCase().indexOf(" and ") > -1 ||
            fourinput[i].toLowerCase().indexOf(" or ") > -1 ||
            fourinput[i].toLowerCase().indexOf(" andnot ") > -1
          ) {
            four +=
              fourorvalue[i] + " " + fourvalue[i] + "(" + fourinput[i] + ") ";
          } else {
            four += fourorvalue[i] + " " + fourvalue[i] + fourinput[i] + " ";
          }
        }
      }

      if (this.fifthRow.input && (one || two || three || four)) {
        if (this.fifthRowNameValue == "(AN/xxx or LSAN/xxx)") {
          if (
            this.fifthRow.input.toLowerCase().indexOf(" and ") > -1 ||
            this.fifthRow.input.toLowerCase().indexOf(" or ") > -1 ||
            this.fifthRow.input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            five =
              " and " +
              "(AN/(" +
              this.fifthRow.input +
              ") or LSAN/(" +
              this.fifthRow.input +
              "))";
          } else {
            five =
              " and " +
              "(AN/" +
              this.fifthRow.input +
              " or LSAN/" +
              this.fifthRow.input +
              ")";
          }
        } else {
          five = " and " + this.fifthRowNameValue + this.fifthRow.input;
        }
      } else if (this.fifthRow.input && !one && !two && !three && !four) {
        if (this.fifthRowNameValue == "(AN/xxx or LSAN/xxx)") {
          if (
            this.fifthRow.input.toLowerCase().indexOf(" and ") > -1 ||
            this.fifthRow.input.toLowerCase().indexOf(" or ") > -1 ||
            this.fifthRow.input.toLowerCase().indexOf(" andnot ") > -1
          ) {
            five =
              "(AN/(" +
              this.fifthRow.input +
              ") or LSAN/(" +
              this.fifthRow.input +
              "))";
          } else {
            five =
              "(AN/" +
              this.fifthRow.input +
              " or LSAN/" +
              this.fifthRow.input +
              ")";
          }
        } else {
          five = this.fifthRowNameValue + this.fifthRow.input;
        }
      }

      for (var i = 0; i < this.sixthRow.length; i++) {
        if (this.sixthRow[i].input && (one || two || three || four || five)) {
          if (this.sixthRow[i].NameValue == "(AN/xxx or LSAN/xxx)") {
            if (
              this.sixthRow[i].input.toLowerCase().indexOf(" and ") > -1 ||
              this.sixthRow[i].input.toLowerCase().indexOf(" or ") > -1 ||
              this.sixthRow[i].input.toLowerCase().indexOf(" andnot ") > -1
            ) {
              six +=
                " " +
                this.sixthRow[i].orValue +
                " " +
                "(AN/(" +
                this.sixthRow[i].input +
                ") or LSAN/(" +
                this.sixthRow[i].input +
                "))";
            } else {
              six +=
                " " +
                this.sixthRow[i].orValue +
                " " +
                "(AN/" +
                this.sixthRow[i].input +
                " or LSAN/" +
                this.sixthRow[i].input +
                ")";
            }
          } else {
            six +=
              " " +
              this.sixthRow[i].orValue +
              " " +
              this.sixthRow[i].NameValue +
              this.sixthRow[i].input;
          }
        } else if (
          this.sixthRow[i].input &&
          !one &&
          !two &&
          !three &&
          !four &&
          !five
        ) {
          sixinput.push(this.sixthRow[i].input);
          sixvalue.push(this.sixthRow[i].NameValue);
          sixorvalue.push(this.sixthRow[i].orValue);
        }
      }
      if (!one && !two && !three && !four && !five && sixinput) {
        sixorvalue[0] = "";
        for (var i = 0; i < sixinput.length; i++) {
          if (sixvalue[i] == "(AN/xxx or LSAN/xxx)") {
            if (
              sixinput.toLowerCase().indexOf(" and ") > -1 ||
              sixinput.toLowerCase().indexOf(" or ") > -1 ||
              sixinput.toLowerCase().indexOf(" andnot ") > -1
            ) {
              six +=
                sixorvalue[i] +
                " " +
                "(AN/(" +
                sixinput[i] +
                ") or LSAN/(" +
                sixinput[i] +
                "))" +
                " ";
            } else {
              six +=
                sixorvalue[i] +
                " " +
                "(AN/" +
                sixinput[i] +
                " or LSAN/" +
                sixinput[i] +
                ")" +
                " ";
            }
          }
          six += sixorvalue[i] + " " + sixvalue[i] + sixinput[i] + " ";
        }
      }

      if (
        this.seventhRow.input &&
        (one || two || three || four || five || six)
      ) {
        if (
          this.seventhRow.input.toLowerCase().indexOf(" and ") > -1 ||
          this.seventhRow.input.toLowerCase().indexOf(" or ") > -1 ||
          this.seventhRow.input.toLowerCase().indexOf(" andnot ") > -1
        ) {
          seven =
            " and " +
            this.seventhRowNumValue +
            "(" +
            this.seventhRow.input +
            ")";
        } else {
          seven = " and " + this.seventhRowNumValue + this.seventhRow.input;
        }
      } else if (
        this.seventhRow.input &&
        !one &&
        !two &&
        !three &&
        !four &&
        !five &&
        !six
      ) {
        if (
          this.seventhRow.input.toLowerCase().indexOf(" and ") > -1 ||
          this.seventhRow.input.toLowerCase().indexOf(" or ") > -1 ||
          this.seventhRow.input.toLowerCase().indexOf(" andnot ") > -1
        ) {
          seven = this.seventhRowNumValue + "(" + this.seventhRow.input + ")";
        } else {
          seven = this.seventhRowNumValue + this.seventhRow.input;
        }
      }

      if (
        this.eighthRow.startTime &&
        (one || two || three || four || five || six || seven)
      ) {
        var nowdate = new Date();
        if (this.eighthRowdateTypeVal == "1" && this.eighthRow.endTime) {
          eight =
            " and " +
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate()) +
            "-" +
            this.eighthRow.endTime.getFullYear() +
            this.Appendzero(this.eighthRow.endTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.endTime.getDate());
        } else if (this.eighthRowdateTypeVal == "2") {
          eight =
            " and " +
            this.eighthRowapplyDateVal +
            "-" +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate());
        } else if (this.eighthRowdateTypeVal == "3") {
          eight =
            " and " +
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate()) +
            "-" +
            nowdate.getFullYear() +
            this.Appendzero(nowdate.getMonth() + 1) +
            this.Appendzero(nowdate.getDate());
        } else if (this.eighthRowdateTypeVal == "4") {
          eight =
            " and " +
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate());
        } else {
          this.$message({
            message:
              this.$cookie.get("lang") === "en"
                ? "The start date and the end date cannot be empty"
                : "开始日期及结束日期不能为空",
            duration: 1500,
            center: true,
          });
        }
      } else if (
        this.eighthRow.startTime &&
        !one &&
        !two &&
        !three &&
        !four &&
        !five &&
        !six &&
        !seven
      ) {
        var nowdate = new Date();
        if (this.eighthRowdateTypeVal == "1" && this.eighthRow.endTime) {
          eight =
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate()) +
            "-" +
            this.eighthRow.endTime.getFullYear() +
            this.Appendzero(this.eighthRow.endTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.endTime.getDate());
        } else if (this.eighthRowdateTypeVal == "2") {
          eight =
            this.eighthRowapplyDateVal +
            "-" +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate());
        } else if (this.eighthRowdateTypeVal == "3") {
          eight =
            this.eighthRowapplyDateVal +
            this.eighthRow.startTime.getFullYear() +
            this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
            this.Appendzero(this.eighthRow.startTime.getDate()) +
            "-" +
            nowdate.getFullYear() +
            this.Appendzero(nowdate.getMonth() + 1) +
            this.Appendzero(nowdate.getDate());
        } else if (this.eighthRowdateTypeVal == "4") {
          eight =
            this.eighthRowapplyDateVal + this.eighthRow.startTime.getFullYear();
          // +
          // this.Appendzero(this.eighthRow.startTime.getMonth() + 1) +
          // this.Appendzero(this.eighthRow.startTime.getDate());
        } else {
          this.$message({
            message:
              this.$cookie.get("lang") === "en"
                ? "The start date and the end date cannot be empty"
                : "开始日期及结束日期不能为空",
            duration: 1500,
            center: true,
          });
        }
      }

      for (var i = 0; i < this.ninthRow.length; i++) {
        if (
          this.ninthRow[i].CustomizedValue &&
          (one || two || three || four || five || six || seven || eight)
        ) {
          if (
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" and ") >
              -1 ||
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" or ") >
              -1 ||
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" andnot ") >
              -1
          ) {
            nine += " and R/(" + this.ninthRow[i].CustomizedValue + ")";
          } else {
            nine += " and R/" + this.ninthRow[i].CustomizedValue;
          }
        } else if (
          this.ninthRow[i].CustomizedValue &&
          !one &&
          !two &&
          !three &&
          !four &&
          !five &&
          !six &&
          !seven &&
          !eight
        ) {
          if (
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" and ") >
              -1 ||
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" or ") >
              -1 ||
            this.ninthRow[i].CustomizedValue.toLowerCase().indexOf(" andnot ") >
              -1
          ) {
            nine += "R/(" + this.ninthRow[i].CustomizedValue + ")";
          } else {
            nine += "R/" + this.ninthRow[i].CustomizedValue;
          }
        }
      }
      if (nine.substr(nine.length - 5) == " and ") {
        nine = nine.substring(0, nine.length - 5);
      }
      all =
        one +
        " " +
        two +
        " " +
        three +
        " " +
        four +
        " " +
        five +
        " " +
        six +
        " " +
        seven +
        " " +
        eight +
        " " +
        nine;
      this.textarea = all
        .replace(/^\s*/g, "")
        .replace(/\s*$/g, "")
        .replace(/\s{2,}/g, " ");
      var _top = $(".Instruction-con").offset().top;
      $("html, body").animate({ scrollTop: _top }, 500);
    },
  },
  mounted () {
    this.init();
    this.clearAll();
  },
};
</script>

<style lang="scss" scoped>
.search-area {
  position: relative;
  width: 100%;
  padding: 20px 10px 10px 20px !important;
  border: 2px solid $mainColor !important;
  border-radius: 8px;
  margin-top: 6px !important;
  box-sizing: border-box;
  background-color: #fff;
  li {
    position: relative;
    &.btn-box {
      // position: absolute;
      // left: 0;
      // bottom: 0;
      // display: flex;
      // align-items: center;
      // justify-content: space-between;
      // width: 100%;
      // height: 80px;
      // padding: 0 20px;
      display: flex;
      justify-content: flex-end;
      margin: 10px 50px;
      border-bottom-left-radius: 8px;
      border-bottom-right-radius: 8px;
      box-sizing: border-box;
      background-color: $color2;
      .btn {
        width: 143px;
        height: 43px;
        border-radius: 30px;
        font-size: 14px;
        font-weight: bold;
        &.clearBtn {
          color: $mainColor;
          background-color: $color149;
        }
        &.searchBtn {
          border-color: transparent;
          color: $color2;
          background-color: $mainColor;
        }
      }
    }
    .elform {
      position: relative;
      display: flex;
      align-items: baseline;
      width: 100%;
      margin-bottom: 16px;
      .tit {
        display: inline-flex;
        align-items: center;
        width: 80px;
        text-align: left;
        font-weight: bold;
        font-size: 12px;
        color: $color6;
      }
      .form-item-box, .form-item-box2 {
        position: relative;
        display: flex;
        width: 100%;
        .item-box {
          position: relative;
          display: inline-flex;
          margin-right: 10px;
          font-size: initial;
          &.date-to-box {
            flex: none;
            width: 30px;
          }
          > span {
            width: 100%;
          }
          .elselect {
            width: 100%;
          }
          .elselect2 {
            flex: 1;
            &.way {
              flex: initial;
              width: 72px;
              margin-right: 10px;
            }
          }
          .el-date-editor {
            width: 100%;
          }
          .icon-riqi {
            position: absolute;
            top: 0;
            right: 10px;
            line-height: 40px;
            font-size: 24px;
            color: $color50;
          }
          .color-box {
            position: absolute;
            top: 0;
            right: 20px;
            .el-color-picker {
              display: flex;
              align-items: center;
              justify-content: center;
            }
            .el-color-picker__trigger {
              width: 15px;
              height: 15px;
              padding: 0;
              border-color: transparent;
            }
            .el-color-picker__icon {
              display: none;
            }
            .el-color-picker__color {
              border: none;
            }
            .el-input__suffix {
              right: 20px;
            }
          }
          .date-to {
            line-height: 40px;
            text-align: center;
            font-size: 12px;
            color: $color6;
          }
        }
        .item-box1{
          flex: 1;
        } 
        .item-box2{
          flex: 2;
        } 
        .tools-box {
          position: relative;
          width: 30px;
          line-height: 40px;
          margin-right: 10px;
          text-align: center;
          font-size: initial;
          .icon {
            transform: scale(1.2);
          }
        }
        .el-input__inner {
          font-size: 12px;
        }
      }
      .form-item-box2 {
        flex-wrap: wrap;
        .display-box {
          position: relative;
          display: inline-flex;
          width: 100%;
          margin-bottom: 16px;
          &:last-of-type {
            margin-bottom: 0;
          }
        }
      }
    }
  }
}

.el-select-dropdown__item {
  &.selected {
    color: $mainColor !important;
  }
}

.icon {
  width: 20px;
  height: 20px;
  vertical-align: text-bottom;
  fill: currentColor;
  overflow: hidden;
}

.rowsPopover {
  .rowsPopover-p {
    font-weight: bold;
    color: $color143;
    padding-bottom: 5px;
    margin-bottom: 5px;
    border-bottom: 1px solid $color58;
  }
  p {
    margin: 5px 0;
    font-size: 12px;
  }
}
</style>
